<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>

<%
    request.setCharacterEncoding("UTF-8");
    String username = request.getParameter("sname");
    byte[] bytes = username.getBytes("ISO-8859-1");
    String username_tmp = new String(bytes, "UTF-8");
    System.out.println("解决后:" + username_tmp);
    //sid=${student.sid}&sname=${student.sname}&sex=${student.sex}&email=${student.email}&telephone=${student.telephone}&addr=${student.addr}&age=${student.age}
    String sid = request.getParameter("sid");
    byte[] sid_bytes = sid.getBytes("ISO-8859-1");
    String sid_tmp = new String(sid_bytes, "UTF-8");
    System.out.println("解决后:" + sid_tmp);

    String sex = request.getParameter("sex");
    byte[] sex_bytes = sex.getBytes("ISO-8859-1");
    String sex_tmp = new String(sex_bytes, "UTF-8");
    System.out.println("解决后:" + sex_tmp);

    String email = request.getParameter("email");
    byte[] email_bytes = email.getBytes("ISO-8859-1");
    String email_tmp = new String(email_bytes, "UTF-8");
    System.out.println("解决后:" + email_tmp);

    String telephone = request.getParameter("telephone");
    byte[] telephone_bytes = telephone.getBytes("ISO-8859-1");
    String telephone_tmp = new String(telephone_bytes, "UTF-8");
    System.out.println("解决后:" + telephone_tmp);

    String addr = request.getParameter("addr");
    byte[] addr_bytes = addr.getBytes("ISO-8859-1");
    String addr_tmp = new String(addr_bytes, "UTF-8");
    System.out.println("解决后:" + addr_tmp);

    String age = request.getParameter("age");
    byte[] age_bytes = age.getBytes("ISO-8859-1");
    String age_tmp = new String(age_bytes, "UTF-8");
    System.out.println("解决后:" + age_tmp);

%>


<form action="/student/edituser" method="post">
	<input type="hidden" name="sid" value="<%=sid_tmp %>" >
	<table border="1" width="400">
		<tr>
			<td>用户姓名</td>
			<td><input type="text" name="sname" value="<%=username_tmp %>"/></td>
		</tr>
		<tr>
			<td>用户性别</td>
			<td>
                <input type="radio" name="sex" value="<%=sex_tmp %>" checked><%=sex_tmp %>
				<input type="radio" name="sex" value="男">男
				<input type="radio" name="sex" value="女">女
			</td>
		</tr>
		<tr>
			<td>用户年龄</td>
			<td><input type="text" name="age" value="<%=age_tmp %>"/></td>
		</tr>
		<tr>
			<td>用户邮箱</td>
			<td><input type="text" name="email" value="<%=email_tmp %>"/></td>
		</tr>
		<tr>
			<td>用户电话</td>
			<td><input type="text" name="telephone" value="<%=telephone_tmp %>"   /></td>
		</tr>
		<tr>
			<td>用户地址</td>
			<td><input type="text" name="addr" value="<%=addr_tmp %>"/></td>
		</tr>
		<tr>
			<td colspan="2"><input type="submit" value="修改"/></td>
		</tr>
	</table>
</form>
</body>
</html>